#set($contextPath = $request.getContextPath())
#macro(buttons $button )
<div class="btn-toolbar">
  #foreach( $btn in $button )
    #set($iconSize = $btn.icon.indexOf(";"))
    #if($iconSize>=0)
     #set($start = $iconSize+1)
     <button id="$!{btn.buttonCode}" class="btn $!btn.icon.substring(0,$iconSize)" menuId="$!{btn.linkMenuId}">
		<i class="fa $!btn.icon.substring($start)"></i>
		$!{btn.buttonName}
	</button>	
    #else
      <button id="$!{btn.buttonCode}" class="btn $!{btn.icon}" menuId="$!{btn.linkMenuId}">
		<i class="fa"></i>
		$!{btn.buttonName}
	</button>	
    #end
  #end
	</div>
#end

#macro(select $dicts $value)
  #foreach( $dict in $dicts )
	<option value="$!{dict.value}" #if($dict.value == $value)selected="selected" #end >$!{dict.name}</option>
  #end
#end

#macro(selectView $dicts $value)
  #foreach( $dict in $dicts )
	#if($dict.value == $value)$!{dict.name} #end
  #end
#end




#macro(resource $resource)
	#foreach( $res in $resource)
	<div class="row">
	#if($res.read == false)
	 <div class="col-xs-12 widget-container-col">
		<div class="widget-box widget-color-blue">
			<div class="widget-header">
			<h5 class="widget-title">
				<input type="checkbox" #if($res.check)checked="checked" #end id="$!{res.menu.menuId}"
				   onclick="menuCheck('$!{res.menu.menuId}','$!{roleId}',this)"/>	 ${res.menu.menuName}			
			</h5>
			</div>
			#if($res.buttons.size() >0 || $res.child.size()>0)
			<div class="widget-body">
				<div class="widget-main row">
					#foreach($btn in $res.buttons)
					 #if($btn.read == false) 
					  <div class="col-xs-12 col-sm-6 col-lg-2">
					     <input type="checkbox" #if($btn.check)checked="checked" #end id="$!{btn.button.buttonId}"
				     onclick="buttonCheck('$!{btn.button.buttonId}','$!{roleId}',this)"/>	 ${btn.button.buttonName}
					  </div>
					  #end
					#end
				</div>
				#if($res.child.size()>0)
				  #resource($res.child)
				#end
			</div>
			#end
		</div>
	 </div>
	 #end
	</div>
	#end
#end


#macro(appresource $resource)
	#foreach( $res in $resource)
	<div class="row">
	#if($res.read == false)
	 <div class="col-xs-12 widget-container-col">
		<div class="widget-box widget-color-blue">
			<div class="widget-header">
			<h5 class="widget-title">
				<input type="checkbox" #if($res.check)checked="checked" #end id="$!{res.menu.menuId}"
				   onclick="menuCheck('$!{res.menu.menuId}','$!{packageId}',this)"/>	 ${res.menu.menuName}			
			</h5>
			</div>
			#if($res.buttons.size() >0 || $res.child.size()>0)
			<div class="widget-body">
				<div class="widget-main row">
					#foreach($btn in $res.buttons)
					 #if($btn.read == false) 
					  <div class="col-xs-12 col-sm-6 col-lg-2">
					     <input type="checkbox" #if($btn.check)checked="checked" #end id="$!{btn.button.buttonId}"
				     onclick="buttonCheck('$!{btn.button.buttonId}','$!{packageId}',this)"/>	 ${btn.button.buttonName}
					  </div>
					  #end
					#end
				</div>
				#if($res.child.size()>0)
				  #resource($res.child)
				#end
			</div>
			#end
		</div>
	 </div>
	 #end
	</div>
	#end
#end

#macro(dictCode $jsons)
   <script type="text/javascript">
	#foreach( $res in $jsons)
	$!{res}
	#end
	</script>
#end	